package com.wufeng.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssConfig {

    @Value("${aliyun.oss.endpoint}")
    private String ossEndpoint;

    @Value("${aliyun.oss.access-key}")
    private String ossAccessKey;

    @Value("${aliyun.oss.secret-key}")
    private String ossSecretKey;

    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(ossEndpoint, ossAccessKey, ossSecretKey);
    }
}
